/**
 * Created by lenovo on 2016/12/9.
 */
/**
 * Created by lenovo on 2016/12/8.
 */
$(function(){
    $(" #navheard #navheard-right #mytb,#navheard #navheard-right #shoucang").hover(
        function(){
            $(this).addClass("open")
            $(this).children("a").css({"background":"#ffffff","color":"#C40000","text-decoration":"underline"})
        },
        function(){
            $(this).removeClass("open")
            $(this).children("a").css({"text-decoration":"none","background":"none","color":"#999999"})
        }
    )
    $("#navheard-right>li:nth-child(9)").mouseover(function(){
        $(this).css('background',"#ffffff");
        $(this).children("a").css({"color":"#C40000","text-decoration":"underline"})
        $(this).children(".shop-support").css("display","block")
    });
    $("#navheard-right>li:nth-child(9)").mouseout(function(){
        $(this).css('background',"none");
        $(this).children("a").css({"color":"#999999","text-decoration":"none"})
        $(this).children(".shop-support").css("display","none")
    });
    $("#webnav").hover(
        function(){
        $(".webnav-contiant").css("display","block")
        $(this).children("a").css({"background":"#ffffff","color":"#C40000","text-decoration":"underline"})
    },
        function(){
            $(".webnav-contiant").css("display","none")
            $(this).children("a").css({"text-decoration":"none","background":"none","color":"#999999"})
        }
    );
    /*////////////////////////////////*/
    /*以上是头部导航条*/
    $(".btn_serch").click(function(){
       $(this).css({"color":"#ffffff","outline":"none"})
    });
    $("#majiaval").focus(function(){
        $(".input-serchs ol").css("display","block")
    })

    $(".input-serchs ol li:last-child").prevUntil().find("a").click(function(){
        $("#majiaval").val($(this).html())
        $(".input-serchs ol").css("display","none")
    })
    $(".input-serchs ol li:last-child").find("a").click(function(){
        $(".input-serchs ol").css("display","none")
    });
    $(".brand div ol li:last-child").toggle(function () {
        $(".brandblock").css("display","none")
        $(".brand-serch,#brandnone").css("display","block")
        $(".brand").css("height", "200px")
        $(this).find("a").html("收起")
        var span=$("<span class='glyphicon glyphicon-chevron-up'></span>")
        $(this).find("a").append(span)
    },
    function(){
        $(".brandblock").css("display","block")
        $(".brand-serch,#brandnone").css("display","none")
        $(".brand").css("height", "66px")
        $(this).find("a").html("更多")
        var span=$("<span class='glyphicon glyphicon-chevron-down'></span>")
        $(this).find("a").append(span)
    });
    $(".style-labe ol li").toggle(function () {
        console.log("1")
        $(".style-labe").css("height","300px")
        $(this).find("a").html("收起")
        var span=$("<span class='glyphicon glyphicon-chevron-up'></span>")
        $(this).find("a").append(span)
    },function(){
        $(".style-labe").css("height","66px")
        $(this).find("a").html("更多")
        var span=$("<span class='glyphicon glyphicon-chevron-down'></span>")
        $(this).find("a").append(span)
    });
    $(".sight-labe ol li").toggle(function () {
        $(".sight-labe").css("height","90px")
        $(this).find("a").html("收起")
        var span=$("<span class='glyphicon glyphicon-chevron-up'></span>")
        $(this).find("a").append(span)
    },function(){
        $(".sight-labe").css("height","40px")
        $(this).find("a").html("更多")
        var span=$("<span class='glyphicon glyphicon-chevron-down'></span>")
        $(this).find("a").append(span)
    });
    $(".hotstyle ol li").toggle(function () {
        $(".hotstyle").css("height","60px")
        $(this).find("a").html("收起")
        var span=$("<span class='glyphicon glyphicon-chevron-up'></span>")
        $(this).find("a").append(span)
    },function(){
        $(".hotstyle").css("height","40px")
        $(this).find("a").html("更多")
        var span=$("<span class='glyphicon glyphicon-chevron-down'></span>")
        $(this).find("a").append(span)
    });
    $(".Style-details ol li").toggle(function () {
        $(".Style-details").css("height","90px")
        $(this).find("a").html("收起")
        var span=$("<span class='glyphicon glyphicon-chevron-up'></span>")
        $(this).find("a").append(span)
    },function(){
        $(".Style-details").css("height","40px")
        $(this).find("a").html("更多")
        var span=$("<span class='glyphicon glyphicon-chevron-down'></span>")
        $(this).find("a").append(span)
    });
    $(".size-labe ol li").toggle(function () {
        $(".size-labe").css("height","150px")
        $(this).find("a").html("收起")
        var span=$("<span class='glyphicon glyphicon-chevron-up'></span>")
        $(this).find("a").append(span)
    },function(){
        $(".size-labe").css("height","40px")
        $(this).find("a").html("更多")
        var span=$("<span class='glyphicon glyphicon-chevron-down'></span>")
        $(this).find("a").append(span)
    });
    $(".more-chose").toggle(function () {
        $(".chosestyel").removeClass("chosehight")
        $(this).html("精简选项")
        var span=$("<span class='glyphicon glyphicon-chevron-up'></span>")
        $(this).append(span)
    },function(){
        $(".chosestyel").addClass("chosehight")
        $(this).html("更多选项")
        var span=$("<span class='glyphicon glyphicon-chevron-down'></span>")
        $(this).append(span)
    });
    $(".city-chose span:nth-child(2)").click(function(){
        $(".city-serch").css("display","block")
    });
    $(".city-serch ul li").click(function(){
        $(".city-chose span:nth-child(2)").html($(this).html())
        $(".city-serch").css("display","none")
    });
    $(".money-serch span input").focus(function(){
        $(".money-serch").css("background","#EFECEB;")
        $(".ready").css("display","block")
        $(".money-serch span input").removeAttr("placeholder")
        console.log("1111")
    });
    $(".ready button:nth-child(1)").click(function(){
        $(".money-serch span input").val("")
    });
    $(".ready button:nth-child(2)").click(function(){
        $(".money-serch").css("background","none;")
        $(".ready").css("display","none")
    })
    $(".condition-serch").siblings().click(function(){
        $(".money-serch").css("background","none;")
        $(".ready").css("display","none")
    })
    $(".year-happy span:nth-child(4) em").toggle(function(){
        $(this).html("收起")
        $(this).next().css("background-position","-48px -13px");
        $(".year-happy span:nth-child(4) div").css("display","block")
    },function(){
        $(this).html("更多")
        $(this).next().css("background-position","-59px -13px");
        $(".year-happy span:nth-child(4) div").css("display","none")
    });
   $(window).scroll(function(){
       var scrollTop=$(this).scrollTop();
       if(scrollTop>=518){
           $(".condition-serch").addClass("xiding")
       }else{
           $(".condition-serch").removeClass("xiding")
       }
   })
})